//
//  LMCommonTableViewCell.m
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 HZMengLiao. All rights reserved.
//

#import "THBaseTableViewCell.h"
#import "THBaseEntity.h"
@interface THBaseTableViewCell ()

@end

@implementation THBaseTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        self.selectionStyle = UITableViewCellSelectionStyleGray;
        self.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
        [self setupUI];
        [self configViews];
        [self setupFrames];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        self.selectionStyle=UITableViewCellSelectionStyleGray;
        self.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
        [self setupUI];
        [self configViews];
        [self setupFrames];
    }
    return self;
}

+ (id)getInstance {
    THBaseTableViewCell *instance = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[self cellIdentifier]];;
    return instance;
}


#pragma mark 添加/配置子视图
/// 添加子控件
- (void)setupUI
{
    //子类实现
}
/// 配置子控件
- (void)configViews
{
    //子类实现
}
/// 布局子控件
- (void)setupFrames
{
    //子类实现
}
+ (NSString *)cellIdentifier
{
    return [[NSString alloc] initWithFormat:@"%@",NSStringFromClass(self)];
}

#pragma mark便于子类快速调用子类
- (void)configureCellWithEntity:(THBaseEntity*)entity
{
    
}
- (void)configTableCellIndexPath:(NSIndexPath*)indexPath
{
    
}

@end
